package com.hongdee.crm.complain.controller;

import com.hongdee.crm.complain.service.ITCrmComplainService;
import com.hongdee.crm.complain.service.impl.ITCrmComplainServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * Created by dell on 2017/6/2.
 */
@RestController
@RequestMapping("/crm/complain")
public class ITCrmComplainController {
    @Autowired
    private ITCrmComplainService itCrmComplainService;

    @RequestMapping("/page")
    @ResponseBody
    public Map newPage(@RequestParam(name = "uid", defaultValue = "") String uid,
                       @RequestParam(name = "token", defaultValue = "") String token,
                       @RequestParam(name = "start", defaultValue = "0") String start,
                       @RequestParam(name = "limit", defaultValue = "50") String limit
    ) throws Exception {
        Map map = this.itCrmComplainService.page(start, limit);
        map.put("success", true);
        map.put("msg", "分页查询成功！");
        return map;

    }
}
